package game;

import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;

public class KeyClass implements KeyListener {
	private gameplayer g;

	public KeyClass(gameplayer g) {
		this.g = g;
	}

	@Override
	public void keyPressed(KeyEvent ke) {
		if (ke.getKeyCode() == ke.VK_UP) {
			g.setPlayerDirection("up");
		}

		if (ke.getKeyCode() == ke.VK_DOWN) {
			g.setPlayerDirection("down");
		}
		if (ke.getKeyCode() == ke.VK_LEFT) {
			g.setPlayerDirection("left");
		}
		if (ke.getKeyCode() == ke.VK_RIGHT) {
			g.setPlayerDirection("right");
		}

	}

	@Override
	public void keyReleased(KeyEvent ke) {

	}

	@Override
	public void keyTyped(KeyEvent arg0) {

	}
}